package com.sundaying.gooway.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Component;

import com.sundaying.gooway.dao.GleanInfoDao;
import com.sundaying.gooway.entity.GleanInfo;

@Component("GleanInfoDao")
public class GleanInfoDaoImpl implements GleanInfoDao {
	private SessionFactory sessionFactory;

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	@Resource(name = "sessionFactory")
	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	public int save(GleanInfo obj) {
		int result=0;
		Session session = sessionFactory.openSession();
		session.beginTransaction();
		session.save(obj);
		session.getTransaction().commit();
		session.close();
		sessionFactory.close();
		result = 1;
		return result;
	}

	@Override
	public int update(GleanInfo obj) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(GleanInfo obj) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public GleanInfo load(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<GleanInfo> list() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<GleanInfo> list(String hql, List<Object> param) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<GleanInfo> list(String hql, List<Object> param, int page,
			int rows) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long count(String hql, List<Object> param) {
		// TODO Auto-generated method stub
		return 0;
	}

}
